src: add setTitle() as alternative to direct assignment#62804
src: add setTitle() as alternative to direct assignment#62804JonathanLopes404 wants to merge 3 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
addaleax
left a comment
There was a problem hiding this comment.
Why does this introduce a new native method? Adding the new API is fine, but it should just trigger the same code paths.
|
@addaleax Updated in latest commit: setTitle now reuses the existing process.title path (removed native method). Could you please take another look? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62804 +/- ##
=======================================
Coverage 89.62% 89.62%
=======================================
Files 706 706
Lines 219137 219152 +15
Branches 41981 41988 +7
=======================================
+ Hits 196397 196417 +20
+ Misses 14632 14607 -25
- Partials 8108 8128 +20
🚀 New features to boost your workflow:
|
|
Would add a reference on bottom of the |
Implement process.setTitle(title) as a new function-based API for setting the process title, complementing the existing process.title property assignment pattern Fixes: nodejs#62797 Signed-off-by: Jonathan Lopes <jonathan15989@protonmail.com>
Add process.setTitle(title) as a new API while reusing the existing process.title assignment behavior instead of introducing a separate native code path. Signed-off-by: Jonathan Lopes <jonathan15989@protonmail.com>
Add a cross-reference at the end of the process.title section to point to process.setTitle() as the new alternative API. Signed-off-by: Jonathan Lopes <jonathan15989@protonmail.com>
f0e771a to
685682f
Compare
|
I'm confused why an alias for Separately, is it expected that if i |
|
Hello @ljharb, Regarding the usefulness: the primary motivation is to support modern ESM usage. Since ESM bindings are read-only, users cannot do About |
|
I checked if there are more similar APIs that would need similar treatment and A deprecation of |
|
Fair point on the ESM usage. |
Implement process.setTitle(title) as a new function-based API for setting the process title, complementing the existing process.title property assignment pattern
Fixes: #62797